package edu.pku.sei.act.taskStruct;

import org.dom4j.Element;
import org.dom4j.Attribute;


public class Ident {
	public String id;
	public String name;
	public Ident(String id, String name)
	{
		if(id == null) this.id = "";
		else this.id = id;
		if(name == null) this.name = "";
		else this.name = name;
	}
	public Ident()
	{		
		id = "";
		name = "";			
	}
	protected void setIdAndName(Element element)
	{
		Attribute attr = element.attribute(TagNames.ID);
		this.id = attr.getValue().trim(); 
		attr = element.attribute(TagNames.NAME);
		this.name = attr.getValue().trim();
	}
	
	public String getId()
	{
		return id;
	}
	
	public String getName()
	{
		return name;
	}
	
	public void addAttributes(Element element)
	{
		element.addAttribute(TagNames.ID, id);
		element.addAttribute(TagNames.NAME, name);
	}
}
